using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text;
using System.Data; 
using yq.IBase; 
using yq.Dictionary; 
using yq.Basis; 
using yq.Model.Logic;
using System.Collections; 
using Db; 
using System.Data.Common;

namespace yq.Model.Base 
{
    ///<summary>
    /// Article_Soft - 软件下载 - 对象基础类
    /// </summary>
    ///<typeparam name="T"></typeparam>
    public abstract class IArticleSoft<T> :ModelBase<ArticleSoft> where T : ArticleSoft, new()
    {
        /// <summary>
        /// 写入主键值
        /// </summary>
        /// <param name="Id">主键</param>
        protected internal override void SetKeyValue(dynamic Id)
        {
            this.SoftId = Id;
        }

        /// <summary>
        /// 获取主键值
        /// </summary>
        /// <returns></returns>
        protected internal override dynamic GetKeyValue()
        {
            return SoftId;
        }

        /// <summary>
        /// 为本对象赋值
        /// </summary>
        /// <param name="dy"></param>
        public override void SetValue(dynamic dy) 
        {
           this.SoftId=dy.SoftId;
           this.ContentId=dy.ContentId;
           this.Title=dy.Title;
           this.SoftSize=dy.SoftSize;
           this.Version=dy.Version;
           this.Developers=dy.Developers;
           this.DevelopersWeb=dy.DevelopersWeb;
           this.Language=dy.Language;
           this.OperatingEnvironment=dy.OperatingEnvironment;
           this.Down=dy.Down;
           this.Explain=dy.Explain;
           this.FileId=dy.FileId;
           this.FileImageId=dy.FileImageId;
        } 

        #region 定义属性

     
         /// <summary>
        /// SoftId
        /// </summary>
        private String _SoftId = "";
      
        /// <summary>
        /// SoftId
        /// </summary>
        public String SoftId
        {
            get 
            {
              return   (this._SoftId); 
            }

            set 
            {
                    _SoftId= value;  
            }
        }
       
     
         /// <summary>
        /// 内容ID
        /// </summary>
        private String _ContentId = "";
      
        /// <summary>
        /// 内容ID
        /// </summary>
        public String ContentId
        {
            get 
            {
              return   (this._ContentId); 
            }

            set 
            {
                    _ContentId= value;  
            }
        }
       
     
         /// <summary>
        /// 软件名称
        /// </summary>
        private String _Title = "";
      
        /// <summary>
        /// 软件名称
        /// </summary>
        public String Title
        {
            get 
            {
              return   (this._Title); 
            }

            set 
            {
                    _Title= value;  
            }
        }
       
     
         /// <summary>
        /// 软件大小
        /// </summary>
        private int _SoftSize =int.MinValue;
      
        /// <summary>
        /// 软件大小
        /// </summary>
        public int SoftSize
        {
            get 
            {
              return   (this._SoftSize); 
            }

            set 
            {
                    _SoftSize= value;  
            }
        }
       
     
         /// <summary>
        /// 版本号
        /// </summary>
        private String _Version = "";
      
        /// <summary>
        /// 版本号
        /// </summary>
        public String Version
        {
            get 
            {
              return   (this._Version); 
            }

            set 
            {
                    _Version= value;  
            }
        }
       
     
         /// <summary>
        /// 开发商
        /// </summary>
        private String _Developers = "";
      
        /// <summary>
        /// 开发商
        /// </summary>
        public String Developers
        {
            get 
            {
              return   (this._Developers); 
            }

            set 
            {
                    _Developers= value;  
            }
        }
       
     
         /// <summary>
        /// 开发商网站
        /// </summary>
        private String _DevelopersWeb = "";
      
        /// <summary>
        /// 开发商网站
        /// </summary>
        public String DevelopersWeb
        {
            get 
            {
              return   (this._DevelopersWeb); 
            }

            set 
            {
                    _DevelopersWeb= value;  
            }
        }
       
     
         /// <summary>
        /// 语言
        /// </summary>
        private String _Language = "";
      
        /// <summary>
        /// 语言
        /// </summary>
        public String Language
        {
            get 
            {
              return   (this._Language); 
            }

            set 
            {
                    _Language= value;  
            }
        }
       
     
         /// <summary>
        /// 运行环境
        /// </summary>
        private String _OperatingEnvironment = "";
      
        /// <summary>
        /// 运行环境
        /// </summary>
        public String OperatingEnvironment
        {
            get 
            {
              return   (this._OperatingEnvironment); 
            }

            set 
            {
                    _OperatingEnvironment= value;  
            }
        }
       
     
         /// <summary>
        /// 下载次数
        /// </summary>
        private int _Down =int.MinValue;
      
        /// <summary>
        /// 下载次数
        /// </summary>
        public int Down
        {
            get 
            {
              return   (this._Down); 
            }

            set 
            {
                    _Down= value;  
            }
        }
       
     
         /// <summary>
        /// 软件介绍
        /// </summary>
        private String _Explain = "";
      
        /// <summary>
        /// 软件介绍
        /// </summary>
        public String Explain
        {
            get 
            {
              return   (this._Explain); 
            }

            set 
            {
                    _Explain= value;  
            }
        }
       
     
         /// <summary>
        /// 软件文件ID
        /// </summary>
        private String _FileId = "";
      
        /// <summary>
        /// 软件文件ID
        /// </summary>
        public String FileId
        {
            get 
            {
              return   (this._FileId); 
            }

            set 
            {
                    _FileId= value;  
            }
        }
       
     
         /// <summary>
        /// 软件截图ID
        /// </summary>
        private String _FileImageId = "";
      
        /// <summary>
        /// 软件截图ID
        /// </summary>
        public String FileImageId
        {
            get 
            {
              return   (this._FileImageId); 
            }

            set 
            {
                    _FileImageId= value;  
            }
        }
       

      #endregion 定义属性 

          protected internal override void SetValue(ArticleSoft info, DataRow row) 
          { 
               if (row == null) 
               { 
                 info.IsLoad = false; 
               }
               else 
               { 
                  info.IsLoad = true; 
                  
                  if(row["SoftId"]!= DBNull.Value)
                  {
                  info.SoftId=row["SoftId"].ToString();
                 }
                 
                  
                  if(row["ContentId"]!= DBNull.Value)
                  {
                  info.ContentId=row["ContentId"].ToString();
                 }
                 
                  
                  if(row["Title"]!= DBNull.Value)
                  {
                  info.Title=row["Title"].ToString();
                 }
                 
                  
                  if(row["SoftSize"]!= DBNull.Value)
                  {
                  info.SoftSize=Convert.ToInt32(row["SoftSize"]);
                 }
                 
                  
                  if(row["Version"]!= DBNull.Value)
                  {
                  info.Version=row["Version"].ToString();
                 }
                 
                  
                  if(row["Developers"]!= DBNull.Value)
                  {
                  info.Developers=row["Developers"].ToString();
                 }
                 
                  
                  if(row["DevelopersWeb"]!= DBNull.Value)
                  {
                  info.DevelopersWeb=row["DevelopersWeb"].ToString();
                 }
                 
                  
                  if(row["Language"]!= DBNull.Value)
                  {
                  info.Language=row["Language"].ToString();
                 }
                 
                  
                  if(row["OperatingEnvironment"]!= DBNull.Value)
                  {
                  info.OperatingEnvironment=row["OperatingEnvironment"].ToString();
                 }
                 
                  
                  if(row["Down"]!= DBNull.Value)
                  {
                  info.Down=Convert.ToInt32(row["Down"]);
                 }
                 
                  
                  if(row["Explain"]!= DBNull.Value)
                  {
                  info.Explain=row["Explain"].ToString();
                 }
                 
                  
                  if(row["FileId"]!= DBNull.Value)
                  {
                  info.FileId=row["FileId"].ToString();
                 }
                 
                  
                  if(row["FileImageId"]!= DBNull.Value)
                  {
                  info.FileImageId=row["FileImageId"].ToString();
                 }
                 
               } 

          } 

        protected internal override void GetDbParameters(DbCommand comm, ArticleSoft info, DbHelper cn) 
        { 
             
                cn.AddInParameter(comm, "@SoftId", DbType.String,ParameterTool.GetObj( info._SoftId )); 
            
             
                cn.AddInParameter(comm, "@ContentId", DbType.String,ParameterTool.GetObj( info._ContentId )); 
            
             
                cn.AddInParameter(comm, "@Title", DbType.String,ParameterTool.GetObj( info._Title )); 
            
             
                cn.AddInParameter(comm, "@SoftSize", DbType.Int32,ParameterTool.GetObj( info._SoftSize )); 
            
                
                cn.AddInParameter(comm,"@Version", DbType.String, Guid.NewGuid().ToString());
              

                cn.AddInParameter(comm,"@_versionOdl", DbType.String, info._Version); 
                 
             
                cn.AddInParameter(comm, "@Developers", DbType.String,ParameterTool.GetObj( info._Developers )); 
            
             
                cn.AddInParameter(comm, "@DevelopersWeb", DbType.String,ParameterTool.GetObj( info._DevelopersWeb )); 
            
             
                cn.AddInParameter(comm, "@Language", DbType.String,ParameterTool.GetObj( info._Language )); 
            
             
                cn.AddInParameter(comm, "@OperatingEnvironment", DbType.String,ParameterTool.GetObj( info._OperatingEnvironment )); 
            
             
                cn.AddInParameter(comm, "@Down", DbType.Int32,ParameterTool.GetObj( info._Down )); 
            
             
                cn.AddInParameter(comm, "@Explain", DbType.String,ParameterTool.GetObj( info._Explain )); 
            
             
                cn.AddInParameter(comm, "@FileId", DbType.String,ParameterTool.GetObj( info._FileId )); 
            
             
                cn.AddInParameter(comm, "@FileImageId", DbType.String,ParameterTool.GetObj( info._FileImageId )); 
            
        } 

    } 
} 